<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Bai 2.5</title>
</head>

<body>
<?php
	if(isset($_POST["canh_a"])&&isset($_POST["canh_b"]))
	{
		$canh_a=$_POST["canh_a"];	
		$canh_b=$_POST["canh_b"];	
		$canh_huyen=sqrt(pow($canh_a,2)+pow($canh_b,2));
	}
?>
<form id="form1" name="form1" method="post" action="Bai2_5.php">
  <table width="350" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr bgcolor="#FF3300">
      <td colspan="2" style="text-align: center; font-weight: bold;"><span style="text-align: center"></span>CẠNH HUYỀN TAM GIÁC VUÔNG</td>
    </tr>
    <tr>
      <td bgcolor="#FFCC99">Cạnh A:</td>
      <td bgcolor="#FFCC99"><input name="canh_a" type="text" id="canh_a" value="<?php echo $canh_a; ?>" /></td>
    </tr>
    <tr>
      <td bgcolor="#FFCC99">Cạnh B:</td>
      <td bgcolor="#FFCC99"><input name="canh_b" type="text" id="canh_b" value="<?php echo $canh_b; ?>" /></td>
    </tr>
    <tr>
      <td bgcolor="#FFCC99">Cạnh huyền:</td>
      <td bgcolor="#FFCC99"><input name="canh_huyen" type="text" id="canh_huyen" style="background-color:#F69" value="<?php echo $canh_huyen; ?>" readonly="readonly" /></td>
    </tr>
    <tr bgcolor="#3784BF">
      <td colspan="2" bgcolor="#FFCC99" style="text-align: center"><input type="submit" name="submit" id="submit" value="Tính" /></td>
    </tr>
  </table>
</form>
</body>
</html>